﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Littlefish.Validation
{
    /// <summary>
    /// Object that holds a single Validation Error for the business object
    /// </summary>
    public class ValidationError
    {

        /// <summary>
        /// The error message for this validation error.
        /// </summary>
        public string Message
        {
            get
            {
                return this.cMessage;
            }
            set
            {
                this.cMessage = value;
            }
        }
        string cMessage = "";

        /// <summary>
        /// The name of the field that this error relates to.
        /// </summary>
        public string ControlID
        {
            get { return this.cFieldName; }
            set { this.cFieldName = value; }
        }
        string cFieldName = "";

        /// <summary>
        /// An ID set for the Error. This ID can be used as a correlation between bus object and UI code.
        /// </summary>
        public string ID
        {
            get { return this.cID; }
            set { this.cID = value; }
        }
        string cID = "";

        public ValidationError() : base() { }
        public ValidationError(string Message)
        {
            this.Message = Message;
        }
        public ValidationError(string Message, string FieldName)
        {
            this.Message = Message;
            this.ControlID = FieldName;
        }
        public ValidationError(string Message, string FieldName, string ID)
        {
            this.Message = Message;
            this.ControlID = FieldName;
            this.ID = ID;
        }

    }
}
